From: Florian Müllner Date: Sat, 30 Jul 2022 11:07:31 +0000 (+0200) Subject: status/brightness: Improve proxy error handling X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~211 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ed2ae06f3502ecd745dda529f61078afdf8962f3;p=gnome-shell.git status/brightness: Improve proxy error handling On error, we currently print a warning and bail out early. That means we don't hide the slider, despite it being non-functional without the proxy. Fix this by making sure _sync() is called in any case. While at it, use an appropriate log level for the warning message. Part-of: --- diff --git a/js/ui/status/brightness.js b/js/ui/status/brightness.js index 61258bd59..5a46c36ff 100644 --- a/js/ui/status/brightness.js +++ b/js/ui/status/brightness.js @@ -20,15 +20,13 @@ class Indicator extends PanelMenu.SystemIndicator { _init() { super._init(); this._proxy = new BrightnessProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH, - (proxy, error) => { - if (error) { - log(error.message); - return; - } - - this._proxy.connect('g-properties-changed', this._sync.bind(this)); - this._sync(); - }); + (proxy, error) => { + if (error) + console.error(error.message); + else + this._proxy.connect('g-properties-changed', () => this._sync()); + this._sync(); + }); this._item = new PopupMenu.PopupBaseMenuItem({ activate: false }); this.menu.addMenuItem(this._item);